/**
 * @Description: 商品相关接口
 * @Author: wrysunny
 * @Date: 2024-11-21 13:37:52
 * @LastEditor: wrysunny
 * @LastEditTime: 2024-12-11 15:44:13
 */
import http from '@/utils/http.js';
//获取商品分类
export const getGoodsClass = (params) => http.get('/public/good/category/all', params);

//获取商品列表
export const getGoodsList = (params) => http.get('/public/good/list', params);

//获取商品评论
export const getGoodsComment = (goodId, params) => http.get(`/auth/order/comment/page/${goodId}`, params);

//获取商品评论统计
export const getGoodsCommentCount = (goodId) => http.get(`/auth/order/getTakeCode/${goodId}`);

//获取菜单商品列表
export const getGoodsListByMenu = (params) => http.get('/public/good/canteen/list', params);

//获取菜单商品详情
export const getGoodsDetailByMenu = (params) => http.get('/public/good/canteen/detail', params);

//获取团购商品详情
export const getGoodsDetailByGroup = (params) => http.get('/auth/group/list', params);

//获取团购购买人
export const getGoodsGroupBuyer = (params) => http.get('/auth/group/buy/info', params);

//收藏商品
export const collectGoods = (goodId) => http.post(`/auth/user/collect?goodId=${goodId}`);

//收藏商品查询
export const getCollectGoods = (params) => http.get('/auth/collect/list', params);

//加入购物车
export const addCart = (data) => http.post('/auth/car/add', data);

//修改购物车
export const updateCart = (data) => http.put('/auth/car/batchUpdate', data);

//删除购物车
export const deleteCart = (data) => http.delete(`/auth/car/delete`, data);

//获取购物车列表
export const getCartList = (params) => http.get('/auth/car/list', params);